package com.yunhe.rentcars.pro.controller.rent;


import com.yunhe.rentcars.pro.entity.rent.Cars;
import com.yunhe.rentcars.pro.service.car.CarsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;


@Controller
@RequestMapping("/rent")
public class CustomerRegisController {

    @Autowired
    private CarsService carsService;

    /*
    * 客户登记页面1
    */
    @RequestMapping("/customerRegis")
    public String addClient() {
          return "rent/CustomerRegis";
    }


    /*
    * 租车信息列表
    */
    @RequestMapping("/carList")
    public String  rentCarList() {
        return "rent/CarList";
   /* @RequestMapping("/add")
    public String add() {
        return "rent/SelectionAddr";
    }*/
    }

    @RequestMapping("/orderSub")
    public String orderSub(Long carid, String carcode, HttpServletRequest req){
        Cars cars = carsService.findOne(carid, carcode);
        req.setAttribute("cars",cars);
        return "rent/OrderSub";
    }

}
